import { ResPage } from '@/api/interface'
import { MountainPeak } from './interface'
import { TBY } from '@/api/config/servicePort'
import http from '@/api'

export const pageMountainPeak = (params: MountainPeak.Query) => {
  return http.get<ResPage<MountainPeak.Record>>(TBY + `/mountain_peak/page`, params)
}

// 山峰详情
export const getMountainPeakDetail = (id: number) => {
  return http.get<Partial<MountainPeak.Form>>(TBY + `/mountain_peak/get`, { id }, { loading: false })
}

// 新增或修改山峰
export const saveOrUpdateMountainPeak = (params: Partial<MountainPeak.Form>) => {
  return http.post(TBY + `/mountain_peak/save`, params)
}

// 删除山峰
export const removeMountainPeak = (id: number) => {
  return http.delete(TBY + `/mountain_peak/delete`, { id })
}
